CREATE TABLE [dbo].[C_TOPFOUR]
(
[cup] [numeric] (4, 0) NOT NULL,
[position] [numeric] (1, 0) NOT NULL,
[team] [varchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[C_TOPFOUR] ADD CONSTRAINT [ch_C_TopFour_pos] CHECK (([position]>(0) AND [position]<=(4)))
GO
ALTER TABLE [dbo].[C_TOPFOUR] ADD CONSTRAINT [pk_C_TopFour] PRIMARY KEY CLUSTERED  ([cup], [position]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[C_TOPFOUR] ADD CONSTRAINT [uk_C_TopFour_team] UNIQUE NONCLUSTERED  ([cup], [team]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[C_TOPFOUR] ADD CONSTRAINT [fk_C_TopFour_cup] FOREIGN KEY ([cup]) REFERENCES [dbo].[C_CUPS] ([cup])
GO
ALTER TABLE [dbo].[C_TOPFOUR] ADD CONSTRAINT [fk_C_TopFour_team] FOREIGN KEY ([team]) REFERENCES [dbo].[C_TEAMS] ([team])
GO
